//Javascript

//使用jquery.nicescroll.js插件的配置
$.qxNiceScrollOpts = {
	cursoropacitymin:0.5,
    cursoropacitymax:0.8,
    bouncescroll:false,
    cursorcolor:'#999',
    cursorwidth:"8px"
};

//使用jquery.nicescroll.js插件对所有页面的滚动条进行处理
$(function(){
	if($.fn.niceScroll){
		var niceScrollObj = $("html").niceScroll($.qxNiceScrollOpts);
		$.qxPageNiceScrollObj = {
			scroll:function(){
				niceScrollObj.onResize();
				$("html").scroll();
			}
		};
	}
	$.qxPageScroll=function(){
		if($.qxPageNiceScrollObj){
			$.qxPageNiceScrollObj.scroll();
		}
	};
});


/**
 * JavaScript散列表
 */
function JSHashtable(){
	var _hash = {};
	this.clear=function(){
		_hash = {};
	};
	this.put=function(key,value){
		if (key!=null){
			_hash[key]=(typeof(value)=="undefined"?null:value);
		}else{
			throw new Error("JSHashtable键不能为空！");
		}
	};
	this.get=function(key){
		return _hash[key];
	};
	this.remove=function(key){
		delete _hash[key];
	};
	this.size=function(){
		var size=0;
		for(var i in _hash){
			size++;
		}
		return size;
	};
	this.getKeys=function(){
		var ks=new Array();
		for(var i in _hash){
			ks.push(i);
		}
		return ks;
	};
	this.getValues=function(){
		var vs=new Array();
		for(var i in _hash){
			vs.push(_hash[i]);
		}
		return vs;
	};
	this.isEmpty=function(){
		return (parseInt(this.size())==0)?true:false;
	};
	this.containsKey=function(key){
		return typeof(_hash[key])!="undefined";
	};
	this.containsValue=function(value){
		var contains=false;
		if(typeof(value)!="undefined"){
			for(var i in _hash){
				if(_hash[i]==value){
					contains=true;
					break;
				}
			}
		}
		return contains;
	};
	this.toString=function(){
		var str="{";
		for(var i in _hash){
			str=str+i+":"+_hash[i]+",";
		}
		if(str.length>1){
			str=str.substring(0,str.length-1);
		}
		return str+"}";
	};
}

